!
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <input type="text" class="user">
    <input type="text" class="pwd">
    <button>注册</button>

    <script src="../../js/ajax_v2.js"></script>
    <script>

        document.querySelector('button').onclick = function () {
            const username = document.querySelector('.user').value;
            const password = document.querySelector('.pwd').value;

            // 校验

            ajax({
                type: 'post',
                url: 'http://192.168.58.25/php/reg.php',
                data: {
                    username,
                    password
                }
            })
                .then(res => {
                    console.log(res);
                })

        }









    </script>

</body>

</html>